<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form method="post" action="?m=pointcard&c=admin_pointcard&a=add" name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
	<tr>
		<th width="80"><strong><?php echo L('pointcard_card_no')?></strong></th>
		<td><input name="pointcard[card_sn]" id="card_sn" class="input-text" type="text" size="50" ></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('pointcard_card_pwd')?></strong></th>
		<td><input name="pointcard[card_pwd]" id="card_pwd" class="input-text" type="text" size="50" ></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('pointcard_card_value')?></strong></th>
		<td><input name="pointcard[card_value]" id="card_value" class="input-text" type="text" size="50" ></td>
	</tr>
	<tr>
		<th><strong><?php echo L('pointcard_endtime')?>：</strong></th>
		<td><?php echo form::date('pointcard[endtime]', $pc_info['endtime'], 1);?></td>
	</tr>
	</tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" class="dialog" value=" <?php echo L('clear')?> ">
</form>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#card_sn').formValidator({onshow:"<?php echo L('input_pointcard_title')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('title_cannot_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=pointcard&c=admin_pointcard&a=public_check_title",datatype:"html",cached:false,async:'true',success : function(data) {
        if( data == "1" )
		{
            return true;
		}
        else
		{
            return false;
		}
	},
	error: function(){alert("<?php echo L('server_no_data')?>");},
	onerror : "<?php echo L('pointcard_exist')?>",
	onwait : "<?php echo L('checking')?>"
	});	
	$('#card_pwd').formValidator({onshow:"<?php echo L('input_card_pwd')?>",onfocus:"<?php echo L('input_card_pwd')?>",oncorrect:"<?php echo L('right_all')?>"}).inputValidator({min:1,onerror:"<?php echo L('no_input_card_pwd')?>"}).ajaxValidator({type:"get",url:"",data:"m=pointcard&c=admin_pointcard&a=public_check_pwd",datatype:"html",cached:false,async:'true',success : function(data) {
        if( data == "1" )
		{
            return true;
		}
        else
		{
            return false;
		}
	},
	error: function(){alert("<?php echo L('server_no_data')?>");},
	onerror : "<?php echo L('pointcard_pwd_exist')?>",
	onwait : "<?php echo L('checking')?>"
	});	
	$('#card_value').formValidator({onshow:"<?php echo L('input_card_value')?>",onfocus:"<?php echo L('input_card_value')?>",oncorrect:"<?php echo L('right_all')?>"}).inputValidator({min:1,onerror:"<?php echo L('no_input_card_value')?>"});
	$('#endtime').formValidator({onshow:"<?php echo L('select_downdate')?>",onfocus:"<?php echo L('select_downdate')?>",oncorrect:"<?php echo L('right_all')?>"});
});
</script>